<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>cppMISC: itfcSocket结构体 参考</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<script type="text/javascript" src="../../clipboard.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../cookie.js"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/javascript" src="../../darkmode_toggle.js"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">cppMISC<span id="projectnumber">&#160;v1.1</span>
   </div>
   <div id="projectbrief">cppMisc 文档系统</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(1); });
/* @license-end */
</script>
<script type="text/javascript" src="../../menudata.js"></script>
<script type="text/javascript" src="../../menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('../../',true,false,'search.php','搜索',false);
  $(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){ initResizable(false); });
/* @license-end */
</script>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">载入中...</div>
<div class="SRStatus" id="Searching">搜索中...</div>
<div class="SRStatus" id="NoMatches">未找到</div>
</div>
</div>
</div>
</div>

</div><!-- top -->
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public 成员函数</a> &#124;
<a href="../../d8/deb/structitfc_socket-members.html">所有成员列表</a>  </div>
  <div class="headertitle"><div class="title">itfcSocket结构体 参考<span class="mlabels"><span class="mlabel">abstract</span></span></div></div>
</div><!--header-->
<div class="contents">

<p>TCP客户端的接口定义  
 <a href="#details">更多...</a></p>

<p><code>#include &lt;<a class="el" href="../../d7/d66/socketbase_8hpp_source.html">socketbase.hpp</a>&gt;</code></p>
<div class="dynheader">
类 itfcSocket 继承关系图:</div>
<div class="dyncontent">
<div class="center"><img src="../../d6/d3c/structitfc_socket__inherit__graph.png" border="0" usemap="#aitfc_socket_inherit__map" alt="Inheritance graph"/></div>
<map name="aitfc_socket_inherit__map" id="aitfc_socket_inherit__map">
<area shape="rect" title="TCP客户端的接口定义" alt="" coords="116,5,284,453"/>
<area shape="rect" href="../../d3/d70/classprivate_____1_1ssl_socket____.html" title=" " alt="" coords="5,501,197,1157"/>
<area shape="poly" title=" " alt="" coords="163,469,158,502,153,501,158,468"/>
<area shape="rect" href="../../de/d8e/classtcp_linux.html" title="linux的TCP客户端.使用epoll实现" alt="" coords="222,544,375,1115"/>
<area shape="poly" title=" " alt="" coords="242,468,254,544,249,545,237,469"/>
</map>
</div>
<div class="dynheader">
itfcSocket 的协作图:</div>
<div class="dyncontent">
<div class="center"><img src="../../d3/d5b/structitfc_socket__coll__graph.png" border="0" usemap="#aitfc_socket_coll__map" alt="Collaboration graph"/></div>
<map name="aitfc_socket_coll__map" id="aitfc_socket_coll__map">
<area shape="rect" title="TCP客户端的接口定义" alt="" coords="5,5,173,453"/>
</map>
</div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public 成员函数</h2></td></tr>
<tr class="memitem:a1777749b032759546aec3b01d12e4956" id="r_a1777749b032759546aec3b01d12e4956"><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a1777749b032759546aec3b01d12e4956">connect</a> ()=0</td></tr>
<tr class="separator:a1777749b032759546aec3b01d12e4956"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acb64626726a7c6458504cff01c8b470b" id="r_acb64626726a7c6458504cff01c8b470b"><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#acb64626726a7c6458504cff01c8b470b">connect</a> (const std::string &amp;url)=0</td></tr>
<tr class="memdesc:acb64626726a7c6458504cff01c8b470b"><td class="mdescLeft">&#160;</td><td class="mdescRight">这个函数处理标准URL连接方式  <br /></td></tr>
<tr class="separator:acb64626726a7c6458504cff01c8b470b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae54a7448b24a67b20a662592784112f6" id="r_ae54a7448b24a67b20a662592784112f6"><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ae54a7448b24a67b20a662592784112f6">connect</a> (const std::string &amp;url, uint16_t port)=0</td></tr>
<tr class="separator:ae54a7448b24a67b20a662592784112f6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1769a8c961b5163ce0ee26d1ff4278d1" id="r_a1769a8c961b5163ce0ee26d1ff4278d1"><td class="memItemLeft" align="right" valign="top">virtual size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a1769a8c961b5163ce0ee26d1ff4278d1">send</a> (const uint8_t *data, size_t len)=0</td></tr>
<tr class="separator:a1769a8c961b5163ce0ee26d1ff4278d1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad2f66521e7eeb5ab6b1c9392da52f4c8" id="r_ad2f66521e7eeb5ab6b1c9392da52f4c8"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ad2f66521e7eeb5ab6b1c9392da52f4c8">close</a> ()=0</td></tr>
<tr class="separator:ad2f66521e7eeb5ab6b1c9392da52f4c8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a69285d052bcea934fb680b5840dba587" id="r_a69285d052bcea934fb680b5840dba587"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a69285d052bcea934fb680b5840dba587">onRecv</a> (std::function&lt; void(native_socket fd) &gt; fun)=0</td></tr>
<tr class="separator:a69285d052bcea934fb680b5840dba587"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a239bf4c19c4484d3ebcda9caff837a60" id="r_a239bf4c19c4484d3ebcda9caff837a60"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a239bf4c19c4484d3ebcda9caff837a60">onData</a> (std::function&lt; void(const uint8_t *data, size_t len)&gt; fun)=0</td></tr>
<tr class="separator:a239bf4c19c4484d3ebcda9caff837a60"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a40e80971cd347acf37851173c1e6b07a" id="r_a40e80971cd347acf37851173c1e6b07a"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a40e80971cd347acf37851173c1e6b07a">run</a> (bool sw)=0</td></tr>
<tr class="separator:a40e80971cd347acf37851173c1e6b07a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a625dcd5ca7cc970bc09450e5c257c572" id="r_a625dcd5ca7cc970bc09450e5c257c572"><td class="memItemLeft" align="right" valign="top">virtual native_socket&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a625dcd5ca7cc970bc09450e5c257c572">getHandle</a> ()=0</td></tr>
<tr class="separator:a625dcd5ca7cc970bc09450e5c257c572"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><p>TCP客户端的接口定义 </p>
<dl class="section version"><dt>版本</dt><dd>1.0 </dd></dl>
<dl class="section author"><dt>作者</dt><dd>宋炜 </dd></dl>
<dl class="section date"><dt>日期</dt><dd>2023-9-11 </dd></dl>

<p class="definition">在文件 <a class="el" href="../../d7/d66/socketbase_8hpp_source.html">socketbase.hpp</a> 第 <a class="el" href="../../d7/d66/socketbase_8hpp_source.html#l00013">13</a> 行定义.</p>
</div><h2 class="groupheader">成员函数说明</h2>
<a id="ad2f66521e7eeb5ab6b1c9392da52f4c8" name="ad2f66521e7eeb5ab6b1c9392da52f4c8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad2f66521e7eeb5ab6b1c9392da52f4c8">&#9670;&#160;</a></span>close()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void itfcSocket::close </td>
          <td>(</td>
          <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>在 <a class="el" href="../../d3/d70/classprivate_____1_1ssl_socket____.html#a546f6f8fa1a3308ee418a4ecafe8cf01">private__::sslSocket__&lt; impType &gt;</a> , 以及 <a class="el" href="../../de/d8e/classtcp_linux.html#a6af19328b9cd2d6f9370fe19e8650e3c">tcpLinux</a> 内被实现.</p>

</div>
</div>
<a id="a1777749b032759546aec3b01d12e4956" name="a1777749b032759546aec3b01d12e4956"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1777749b032759546aec3b01d12e4956">&#9670;&#160;</a></span>connect() <span class="overload">[1/3]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual bool itfcSocket::connect </td>
          <td>(</td>
          <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>在 <a class="el" href="../../d3/d70/classprivate_____1_1ssl_socket____.html#a2d830d8a9ffe7ed2f82f90d5d6768cbd">private__::sslSocket__&lt; impType &gt;</a> , 以及 <a class="el" href="../../de/d8e/classtcp_linux.html#ae15a8916f8f5818a48169a2b1b954cb9">tcpLinux</a> 内被实现.</p>

</div>
</div>
<a id="acb64626726a7c6458504cff01c8b470b" name="acb64626726a7c6458504cff01c8b470b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acb64626726a7c6458504cff01c8b470b">&#9670;&#160;</a></span>connect() <span class="overload">[2/3]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual bool itfcSocket::connect </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;</td>          <td class="paramname"><span class="paramname"><em>url</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>这个函数处理标准URL连接方式 </p>

<p>在 <a class="el" href="../../d3/d70/classprivate_____1_1ssl_socket____.html#a8e55451685e7903fac2208de1886059c">private__::sslSocket__&lt; impType &gt;</a> , 以及 <a class="el" href="../../de/d8e/classtcp_linux.html#a2e5bdf457d17c48c5f299da7f56d5301">tcpLinux</a> 内被实现.</p>

</div>
</div>
<a id="ae54a7448b24a67b20a662592784112f6" name="ae54a7448b24a67b20a662592784112f6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae54a7448b24a67b20a662592784112f6">&#9670;&#160;</a></span>connect() <span class="overload">[3/3]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual bool itfcSocket::connect </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;</td>          <td class="paramname"><span class="paramname"><em>url</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t</td>          <td class="paramname"><span class="paramname"><em>port</em></span>&#160;)</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>在 <a class="el" href="../../d3/d70/classprivate_____1_1ssl_socket____.html#adfa6c24ecbd899cd29351c9074efee02">private__::sslSocket__&lt; impType &gt;</a> , 以及 <a class="el" href="../../de/d8e/classtcp_linux.html#a35c67ca013889ac2087dbdd8d6ba5405">tcpLinux</a> 内被实现.</p>

</div>
</div>
<a id="a625dcd5ca7cc970bc09450e5c257c572" name="a625dcd5ca7cc970bc09450e5c257c572"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a625dcd5ca7cc970bc09450e5c257c572">&#9670;&#160;</a></span>getHandle()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual native_socket itfcSocket::getHandle </td>
          <td>(</td>
          <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>在 <a class="el" href="../../d3/d70/classprivate_____1_1ssl_socket____.html#ae27705d5da12581168e0f2fc5b85d915">private__::sslSocket__&lt; impType &gt;</a> , 以及 <a class="el" href="../../de/d8e/classtcp_linux.html#aa668c67c4622697407b7129da67373a6">tcpLinux</a> 内被实现.</p>

</div>
</div>
<a id="a239bf4c19c4484d3ebcda9caff837a60" name="a239bf4c19c4484d3ebcda9caff837a60"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a239bf4c19c4484d3ebcda9caff837a60">&#9670;&#160;</a></span>onData()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void itfcSocket::onData </td>
          <td>(</td>
          <td class="paramtype">std::function&lt; void(const uint8_t *data, size_t len)&gt;</td>          <td class="paramname"><span class="paramname"><em>fun</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>在 <a class="el" href="../../d3/d70/classprivate_____1_1ssl_socket____.html#a47b24a3af08a4dc82fc02166bbe78cbc">private__::sslSocket__&lt; impType &gt;</a> 内被实现.</p>

</div>
</div>
<a id="a69285d052bcea934fb680b5840dba587" name="a69285d052bcea934fb680b5840dba587"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a69285d052bcea934fb680b5840dba587">&#9670;&#160;</a></span>onRecv()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void itfcSocket::onRecv </td>
          <td>(</td>
          <td class="paramtype">std::function&lt; void(native_socket fd) &gt;</td>          <td class="paramname"><span class="paramname"><em>fun</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<a id="a40e80971cd347acf37851173c1e6b07a" name="a40e80971cd347acf37851173c1e6b07a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a40e80971cd347acf37851173c1e6b07a">&#9670;&#160;</a></span>run()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void itfcSocket::run </td>
          <td>(</td>
          <td class="paramtype">bool</td>          <td class="paramname"><span class="paramname"><em>sw</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>在 <a class="el" href="../../d3/d70/classprivate_____1_1ssl_socket____.html#a72b9f2bcd4ec8c34ba3bfd14588d82a8">private__::sslSocket__&lt; impType &gt;</a> , 以及 <a class="el" href="../../de/d8e/classtcp_linux.html#af1ec1ea5d1f0f4e63eba494c4c436d59">tcpLinux</a> 内被实现.</p>

</div>
</div>
<a id="a1769a8c961b5163ce0ee26d1ff4278d1" name="a1769a8c961b5163ce0ee26d1ff4278d1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1769a8c961b5163ce0ee26d1ff4278d1">&#9670;&#160;</a></span>send()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual size_t itfcSocket::send </td>
          <td>(</td>
          <td class="paramtype">const uint8_t *</td>          <td class="paramname"><span class="paramname"><em>data</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t</td>          <td class="paramname"><span class="paramname"><em>len</em></span>&#160;)</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>在 <a class="el" href="../../d3/d70/classprivate_____1_1ssl_socket____.html#a5ba0aeaf869188d5845eaf1b9a2748c6">private__::sslSocket__&lt; impType &gt;</a> , 以及 <a class="el" href="../../de/d8e/classtcp_linux.html#af8428fda3316b6f9e70f686715754068">tcpLinux</a> 内被实现.</p>

</div>
</div>
<hr/>该结构体的文档由以下文件生成:<ul>
<li>include/details/<a class="el" href="../../d7/d66/socketbase_8hpp_source.html">socketbase.hpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0
</small></address>
</div><!-- doc-content -->
</body>
</html>
